<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
 

	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	
	<ui:define name="content">																																										
	
	<h:form>
	 <p:panel header="Employee application form">   
        <h:panelGrid style="width: 100%;" id="printArea"> 
		
			<h:panelGrid style="width: 100%;" columns="2">
				
				<p:graphicImage value="../../resources/styles/images/logo.png"></p:graphicImage>			
					
				<h:outputText value="#{msg['eformapplicationview.lable.heading']}"	styleClass="outputTextTitle" style="text-align:center;" />
				
			</h:panelGrid>
			
			<h:panelGrid columns="2">
					<h:outputText value="* " style="color:red;" />
					<h:outputText value="Please provide complete and correct information." />
					
					<h:outputText value="* " style="color:red;" />
					<h:outputText value="All fields are personal fields and are mandatory." />
					
					<h:outputText value="* " style="color:red;" />
					<h:outputText value="Please donnot use short forms/abbrevations."/>
					
					<h:outputText value="* " style="color:red;" />
					<h:outputText value="Hardcopy of this form along with supporting documents has to be submitted (duly signed and with a recent colour photograph)to your location contact point." />
			</h:panelGrid>	
			
			 <h:outputText value="Personal Details" styleClass="outputTextSubTitle" />
	         <h:panelGrid columns="6"  cellspacing="10" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailLabel, employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailLabel">
								
				<h:outputLabel value="First Name" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.firstName}" />
				
				<h:outputLabel value="Last Name" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.lastName}" />
				
				<h:outputLabel value="Gender" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.gender}" />
				
				<h:outputLabel value="Primary Skill/Competency" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{newJoinee.primarySkill}" />
				
				<h:outputLabel value="nationality" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.nationality}" />
				
				<h:outputLabel value="Citizenship" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.citizenship}" />
				
				<h:outputLabel value="Date of Birth" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.dateofbirth}" >
				 	<f:convertDateTime  pattern ="dd-MMM-yyyy"/>
				</h:outputText>
				
				<h:outputLabel value="Place of Birth" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.birthPlace}" />
				
				<h:outputLabel value="Maiden Name" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.maidenname}" />
				
				<h:outputLabel value="Mother's Maiden Name" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.mothermaidenName}" />
				
				<h:outputLabel value="Father's Name" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.fathername}" />
				
				<h:outputLabel value="Mother's Name" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.motherName}" />
				
				<h:outputLabel value="Personal Email Id" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.email}" />
				
				<h:outputLabel value="Alternate Email Id" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.alternateEmail}" />
				
				<h:outputLabel value="Current Address" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.currentAddress}" />
				
				<h:outputLabel value="Permanent Address" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.permanentAddress}" />
				
				<h:outputLabel value="Contact Number" />
				<h:outputLabel value=":" />		
				<h:outputText value="#{eformViewBean.newJoinee.telephone}" />
		
				
			</h:panelGrid>
			
			<h:outputText value="Passport/PAN Details" styleClass="outputTextSubTitle" />
			<h:panelGrid columns="6"  cellspacing="10" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailLabel, employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailLabel">	
						
				<h:outputLabel value="Passport Number" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.passportNumber}" />
				
				<h:outputLabel value="Passport Valid Upto" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.passportNumber}" />
				
				<h:outputLabel value="Has your visa ever been rejected ?(If Yes, please provide the following details)" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.VISAEverRejected}" />
				
				<h:outputLabel value="Date of Rejection" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.rejectDate}" > 
					<f:convertDateTime  pattern ="dd-MMM-yyyy"/>
				</h:outputText>
				
				<h:outputLabel value="For which country" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.rejectCountry}" />
				
				<h:outputLabel value="Permanent Account Number(PAN)" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.PANNumber}" />
				
				<h:outputLabel value="Passport Issued Date and Passport Issued Location" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.passportIssueDate}" >
				 	<f:convertDateTime  pattern ="dd-MMM-yyyy"/>
				</h:outputText>
				
				<h:outputLabel value="Driving License Number" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.drivinglicenseNumber}" />
				
				<h:outputLabel value="Driving License Valid up to" />
				<h:outputLabel value=":" />	
				<h:outputText value="#{eformViewBean.passportAndPANDetails.drivinglicenseValidity}" >
				 	<f:convertDateTime  pattern ="dd-MMM-yyyy"/>
				</h:outputText>
							
			</h:panelGrid>
			
			<h:outputText value="Reference(From your current Employer only)" styleClass="outputTextSubTitle" />
			<h:panelGrid cellspacing="7" >
			
				<p:dataTable value = "#{eformViewBean.referencesList}" var="reference">  
				             
					<p:column headerText="Employee Code">
						<h:outputText value="#{reference.employeeCode}" />
					</p:column>
	
					<p:column headerText="Organization">
						<h:outputText value="#{reference.organization}" />
					</p:column>
	
					<p:column headerText="Relationship">
						<h:outputText value="#{reference.relationship}" />
					</p:column>
	
					<p:column headerText="Address">
						<h:outputText value="#{reference.address}" />
					</p:column>
					
			    </p:dataTable>			
			</h:panelGrid>
			
			<h:outputText value="Education Details" styleClass="outputTextSubTitle" />
			<h:panelGrid cellspacing="7" >
			
				<p:dataTable value = "#{eformViewBean.educationsList}" var="education">  
						
					<p:column headerText="Qualification">						
						<h:outputText value="#{education.qualification}" />												
					</p:column>					
				
					<p:column headerText="Institution">
						 	<h:outputText value="#{education.instituteSchoolCollage}"  />
					</p:column>
					
					<p:column headerText="University">
						<h:outputText value="#{education.universityOrBoardName}" />					
					</p:column>
					
					<p:column headerText="Period From">
						<h:outputText value="#{education.periodFrom}"  >
							<f:convertDateTime pattern = "dd-MM-yyyy"/>
						</h:outputText>
					</p:column>
					
					<p:column headerText="Period To">
						<h:outputText value="#{education.periodTo}" >
							<f:convertDateTime  pattern ="dd-MMM-yyyy"/>
						</h:outputText>
					</p:column>
					
					<p:column headerText="Student ID/Reg No.">
						<h:outputText value="#{education.studentId}" />
					</p:column>
					
					<p:column headerText="Program">
				        <h:outputText value="#{education.program}" />
					</p:column>
					
					<p:column headerText="% Marks/CGPA">
					   <h:outputText value="#{education.marks}" />	
					</p:column>	
										
				</p:dataTable>
			
			</h:panelGrid>			
			
			<h:outputText value="Employment Details" styleClass="outputTextSubTitle" />
			<h:panelGrid cellspacing="7" >
				
				<p:dataTable value = "#{eformViewBean.employmentsList}" var="employment">  
						
						<p:column headerText="Company Name">							
							<h:outputText value="#{employment.companyName}" />							     					
						</p:column>
						
						<p:column headerText="Address">
							<h:outputText value="#{employment.address}" />							    					
						</p:column>
						
						<p:column headerText="Employment Type">
							<h:outputText value="#{employment.employmentType}" />							   							    					
						</p:column>
						
						<p:column headerText="Designation">
							<h:outputText value="#{employment.designation}" />												
						</p:column>
						
						<p:column headerText="Reported to">
							<h:outputText value="#{employment.reportsTo}" />													
						</p:column>
						
						<p:column headerText="Reported person's Contact No">
							<h:outputText value="#{employment.reportToContact}" />												
						</p:column>
						
						<p:column headerText="Period From">
							 <h:outputText value="#{employment.periodFrom}" >
							 	<f:convertDateTime  pattern ="dd-MMM-yyyy"/>
							 </h:outputText>													
						</p:column>	
						
						<p:column headerText="Period To">
							 <h:outputText value="#{employment.periodTo}" >
							     <f:convertDateTime  pattern ="dd-MMM-yyyy"/>
							 </h:outputText>													
						</p:column>	
						
						<p:column headerText="Emp code">
							 <h:outputText value="#{employment.employeeCode}" />													
						</p:column>	
						
						<p:column headerText="Last salary(INR)">
							 <h:outputText value="#{employment.lastDrawn}" />							   						
						</p:column>	
						
						<p:column headerText="Reason for Leaving">
							 <h:outputText value="#{employment.reasonOfLeaving}" />													
						</p:column>
						
						<p:column headerText="Mode of seperation">
							 <h:outputText value="#{employment.modeOfSeperation}" />													
						</p:column>	
										
				</p:dataTable>			
			
			</h:panelGrid>
			
			<h:panelGrid columns="3">       
							
				<p:commandButton action="#{eformViewBean.viewLetterOfAuthorization1}" value="Letter of Authorization 1" ajax="false">
					<f:setPropertyActionListener target="#{eformViewBean.newJoinee}" value="#{newJoinee}" />
				</p:commandButton>
					
				<p:commandButton action="#{eformViewBean.viewLetterOfAuthorization2}" value="Letter of Authorization 2" ajax="false">
					<f:setPropertyActionListener target="#{eformViewBean.newJoinee}" value="#{newJoinee}" />
				</p:commandButton>
			    <p:commandButton onclick="emailConfirmationDiaglog.show()" value="Mark As Valid">
					
				</p:commandButton>
			</h:panelGrid>
			
			</h:panelGrid>
	 </p:panel>		
	 <p:commandButton value="Print" type="button" icon="ui-icon-print">
         	<p:printer target="printArea"></p:printer>
     </p:commandButton>	
				<p:confirmDialog widgetVar="emailConfirmationDiaglog" id="emailConfirmationDiaglog" severity="alert" message="Do you want to send a mail to center head ?">
				<h:panelGroup style="text-align: right; float: right;">
					<p:commandButton value="Yes, Send mail"  action="#{eformViewBean.markAsValidNewJoinee}" update="@form" onclick="emailConfirmationDiaglog.hide()" oncomplete="mailStatusDialog.show()">
					</p:commandButton>
					<p:commandButton id="cancel" value="Cancel" onclick="emailConfirmationDiaglog.hide()" type="button" />
				</h:panelGroup>
			</p:confirmDialog>
				
		
		</h:form>
		
		
			
		

		</ui:define>
	</ui:composition>